import * as THREE from 'three';
import { loadGltfAndCreateInstanceMeshWithMatrixWorld } from '../three-utils';

/**
 * 加载低层商业楼
 * @returns
 */
export const loadBusinessZone = (): Promise<THREE.InstancedMesh | null> => {
  const matrixWorldArray = [
    [
      0.005382936832169103, 0, 0.01087122910747109, 0, 0, 0.01213093288242817, 0, 0,
      -0.01087122910747109, 0, 0.005382936832169103, 0, 5.60801887512207, -0.09017162024974823,
      4.393619060516357, 1,
    ],
    [
      -0.010783859632781067, 0, 0.005555902989029542, 0, 0, 0.01213093288242817, 0, 0,
      -0.005555902989029542, 0, -0.010783859632781067, 0, 5.362241268157959, -0.09017162024974823,
      -5.65786600112915, 1,
    ],
    [
      0.010627031972891927, 0, -0.005850283217200303, 0, 0, 0.01213093288242817, 0, 0,
      0.005850283217200303, 0, 0.010627031972891927, 0, -5.5560173988342285, -0.09017162024974823,
      -5.551798343658447, 1,
    ],
    [
      -0.005437326097160527, 0, -0.010844125685017173, 0, 0, 0.01213093288242817, 0, 0,
      0.010844125685017173, 0, -0.005437326097160527, 0, -5.382509231567383, -0.09017162024974823,
      -2.5217130184173584, 1,
    ],
    [
      0.010627031972891927, 0, -0.005850283217200303, 0, 0, 0.01213093288242817, 0, 0,
      0.005850283217200303, 0, 0.010627031972891927, 0, 3.761988401412964, -0.09017162024974823,
      -1.783379316329956, 1,
    ],
    [
      -0.010627033135068048, 0, 0.005850283065044477, 0, 0, 0.01213093288242817, 0, 0,
      -0.005850283065044477, 0, -0.010627033135068048, 0, 1.3305513858795166, -0.09017162024974823,
      -0.43756532669067383, 1,
    ],
  ];

  return loadGltfAndCreateInstanceMeshWithMatrixWorld({
    modelPath: '/model/business-zone/model.glb',
    matrixWorldArray,
  });
};
